ngx.header.content_type="application/json;charset=utf8"
-- local action = ngx.req.get_method()
-- local myquerys = {}
-- if action == "POST" then
--         ngx.req.read_body()
--         local data = ngx.req.get_body_data()
--         myquerys = {method = ngx.HTTP_POST, body = data}
-- else
--     myquerys = {method = ngx.HTTP_GET};
--     myquerys.LogPosition = ngx.req.get_uri_args().LogPosition;
--     myquerys.LatPosition = ngx.req.get_uri_args().LatPosition;
-- end

local myargs =  ngx.req.get_uri_args();
res1, res2 = ngx.location.capture_multi{
    { "/api/CarPortUser/UserQueryCarPortOrder",{args="GaeaObjectProperty=524304&ResultGaeaObjectProperty=0"} },
    { "/api/CarPortManage/SearchShoppingCircleByLocation",{args="LogPosition="..myargs.LogPosition .. "&LatPosition="..myargs.LatPosition} },
} --注意：这里省略了(),相当于({{}})

local json = require "cjson.safe"
json.encode_empty_table_as_object(false)
local temp = json.decode(res2.body);
temp.Data.CarportOrderList = json.decode("[]")
if res1.status == 200
then
    temp.Data.CarportOrderList = json.decode(res1.body).Data.DataList;
end
ngx.say(json.encode(temp));

-- ngx.say(action)
-- ngx.say(json.encode(ngx.req.get_uri_args()))







